//
// Created by liyinbin on 2021/12/25.
//

#ifndef SCYLLA_API_STATUS_H_
#define SCYLLA_API_STATUS_H_

#include <cstdint>

namespace scylla {

    enum class error_code : uint32_t {
        eSuccess = 0
    };

    class status {
    public:
        status() : _code(error_code::eSuccess), _msg() {}

        ~status() {}

        bool is_ok() const { return _code == error_code::eSuccess; }

    private:
        friend bool operator==(const status &lhs, const status &rhs);

    private:
        error_code _code;
        std::string _msg;
    };

    bool operator==(const status &lhs, const status &rhs) {
        return lhs._code == rhs._code;
    }
}  // namespace scylla

#endif  // SCYLLA_API_STATUS_H_
